import React, { Component } from 'react'
import axios from 'axios'

export default class App extends Component {

    getData = () => {
        const url = `http://localhost:3000/api1/user`
        axios.get(url).then(
            res => {
                console.log('success', res.data)
            },
            err => {
                console.log(err)
            })
    }

    render() {
        return (
            <div className="App">
                <button onClick={this.getData}>Get Data</button>
                {/* <button onClick={this.getData}>Get Data</button> */}
            </div>
        )
    }
}